import request from '@/utils/request'

// 查询个人用户列表
export function listPersonalUser(query) {
    return request({
        url: '/business/personalUser/list',
        method: 'get',
        params: query
    })
}

export function searchPersonalUser(query) {
    return request({
        url: '/app-api/business/personalUser/list/search',
        method: 'get',
        params: query
    })
}

// 查询个人用户详细
export function getPersonalUser(id) {
    return request({
        url: '/business/personalUser/' + id,
        method: 'get'
    })
}

// 新增个人用户
export function addPersonalUser(data) {
    return request({
        url: '/business/personalUser',
        method: 'post',
        data: data
    })
}

// 修改个人用户
export function updatePersonalUser(data) {
    return request({
        url: '/business/personalUser',
        method: 'put',
        data: data
    })
}

// 删除个人用户
export function delPersonalUser(id) {
    return request({
        url: '/business/personalUser/' + id,
        method: 'delete'
    })
}

// 修改密码
export function updateUserPwd(data) {
    return request({
        url: '/app-api/member/user/update-pwd',
        method: 'put',
        data: data
    })
}

// 修改用户个人信息
export function updateUserProfile(data) {
    return request({
        url: '/app-api/member/user/update',
        method: 'put',
        data: data
    })
}

// 用户头像上传
export function uploadAvatar(data) {
    return request({
        url: '/app-api/business/personalUser/updateAvatar',
        method: 'post',
        data: data
    })
}
